import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import ElementPlus from 'element-plus';
import 'element-plus/lib/theme-chalk/index.css';
import 'github-markdown-css/github-markdown.css'
import hljs from 'highlight.js'
const app:any = createApp(App)
  app.use(store)
  app.use(router)
  app.use(ElementPlus)
  app.mount("#app");
  app.directive('highlight', function (el:any) {
    const blocks = el.querySelectorAll('pre code')
    blocks.forEach((block: HTMLElement) => {
      hljs.highlightBlock(block)
    })
  })
  const w:any = window;
  app.config.globalProperties.base =  w.location.protocol+"//"+w.location.host